Repository navigation
fix(server): issue URLs on an unconfigured port no longer resolve to another server - #40047
rishabhx29 wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rop ports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceAuthenticate only the default HTTPS Gitea server, add its acme/web checkout, then submit a thread prompt to read and comment on the same repository's issue 3 URL naming port 8443. Both servers contain distinguishable issue titles. Environment: real web app, Chromium, 1280×800, light theme, fresh isolated databases; deterministic ACP driver calls the real MCP tools.
Base reads DEFAULT SERVER issue 3 as writable and posts one comment there. Head refuses both operations and leaves both servers at zero comments. scenarios:prove exited 0. Scenario · ACP driver · Gitea seed script · Reproduction instructions · Proof summary Not shown:
|


Problem
IssueService.resolveUrlfilters projects by exact authority, and when nothing matches the URL's authority it falls back to every project on the same bare host. So a link that names a port nobody configured, likehttps://gitea.test:8443/acme/web/issues/3while onlyhttps://gitea.testis signed in, gets served by the default-port server: the issue read comes back from the wrong server, the resolved record is marked writable, and a comment written through the service lands on the other server's issue. Fixes #38009.Change
A port-bearing link with no binding for its authority is now refused (
IssueUnavailableError,tracker-unsupported) instead of falling back. A port-less link keeps the existing fallback, and a link whose authority does have a binding is unaffected.Scope and approval
Filed as #38009 (unassigned, no comments). One condition change in
resolveUrl, plus a regression test. No caller or API changes.Verification
http://gitea.127.0.0.1.nip.io(port 80, its issue 3 titled "Default port") and server B on the same host at port 8443 (its issue 3 titled "Port 8443"), with only server A configured as a project. I drove the realIssueServicethrough the real Forgejo driver, the real Forgejo CLI stack with a realfjlogin against a real checkout. Onmain,resolveUrlserved the 8443 URL withwritable: true, the issue read returned "Default port" from server A, and a comment written through the service landed on server A's issue 3; server B stayed untouched. With the fix, the same call is refused withIssueUnavailableError(tracker-unsupported) and no read or write reaches either server.IssueService.test.ts: a default-port-only project must refuse a port-bearing URL for the same host. Onmainit fails with the resolved record; with the fix it passes.vp test run src/issue/IssueService.test.ts: 9/9 pass.vp fmt --checkandvp lintclean, and the package typecheck reports no errors on the changed files.Fix, tests, and PR description by GLM-5.3 in ZCode, directed and verified by @rishabhx29.